package HDAPI.examples;
import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import HDAPI.HDBase;

public class InformationExample extends HttpServlet 
{
    public void doGet(HttpServletRequest request, HttpServletResponse response)
    throws IOException, ServletException
    {
    	Utility.initHDAPISettings(this.getServletContext());
        response.setContentType("text/html");
        PrintWriter out = response.getWriter();

        HDBase hd = new HDBase();

		if(hd.information("Nokia", "N95")){
			//redirect to a mobile version
			out.println("Response Message:<br>");
		}else{
			out.println("Request failed.<br>");
		}

		out.println(hd.getInformation().toString());
		Utility.dumpError(hd, out);
    }
}